import 'dart:io';

const filename = "./test/txt";

bool exists(Directory d) {
  var existsSync = d.existsSync();
  if (existsSync) {
    print('${filename} existsSync true');
  } else {
    print('${filename} existsSync false');
  }
  return existsSync;
}

void currentTest() {
  print(Directory.current.path);
  var str =
      '${Platform.pathSeparator}str${Platform.pathSeparator}directory.dart';
  print(Directory.current.path +
      Platform.pathSeparator +
      'std' +
      Platform.pathSeparator +
      'io' +
      Platform.pathSeparator +
      str.substring(str.lastIndexOf(Platform.pathSeparator) + 1));
}

void main() {
  var directory = Directory(filename);
  if (!exists(directory)) {
    directory.createSync(recursive: true);
  }
  if (exists(directory)) {
    directory.deleteSync(recursive: true);
  }
  exists(directory);
  currentTest();
}
